From 6ff5a072505f8892139831e83ff5319183c1e565 Mon Sep 17 00:00:00 2001 From: "sos22@labyrinth.cl.cam.ac.uk" Date: Fri, 4 Jul 2003 11:46:47 +0000 Subject: [PATCH] bitkeeper revision 1.272 (3f056927K6c1zv1tNa8i4njBXcuuQg) Fix a random bunch of compiler warnings all over the tree. --- .rootkeys | 1 + BitKeeper/etc/ignore | 1 + .../arch/xeno/drivers/block/xl_ide.c | 2 +- .../arch/xeno/drivers/block/xl_scsi.c | 2 +- .../arch/xeno/drivers/block/xl_segment_proc.c | 2 + .../arch/xeno/drivers/console/console.c | 4 +- .../arch/xeno/drivers/dom0/dom0_core.c | 7 +- .../arch/xeno/drivers/dom0/dom0_memory.c | 4 +- .../arch/xeno/kernel/process.c | 3 +- .../arch/xeno/kernel/traps.c | 26 +- .../arch/xeno/mm/hypervisor.c | 2 +- xenolinux-2.4.21-sparse/arch/xeno/mm/init.c | 6 +- .../include/asm-xeno/processor.h | 2 +- xenolinux-2.4.21-sparse/include/linux/blk.h | 411 ++++++++++++++++++ 14 files changed, 446 insertions(+), 27 deletions(-) create mode 100644 xenolinux-2.4.21-sparse/include/linux/blk.h diff --git a/.rootkeys b/.rootkeys index d949706cb3..5b98352b81 100644 --- a/.rootkeys +++ b/.rootkeys @@ -568,6 +568,7 @@ 3e5a4e68uJz-xI0IBVMD7xRLQKJDFg xenolinux-2.4.21-sparse/include/asm-xeno/segment.h 3e5a4e68Nfdh6QcOKUTGCaYkf2LmYA xenolinux-2.4.21-sparse/include/asm-xeno/smp.h 3e5a4e68mTr0zcp9SXDbnd-XLrrfxw xenolinux-2.4.21-sparse/include/asm-xeno/system.h +3f056927gMHl7mWB89rb73JahbhQIA xenolinux-2.4.21-sparse/include/linux/blk.h 3e5a4e68WLX3B8owTvktP3HHOtznPQ xenolinux-2.4.21-sparse/include/linux/major.h 3e5a4e686V0nioX2ZpFf056sgvdiQw xenolinux-2.4.21-sparse/include/linux/sunrpc/debug.h 3e5a4e68W_hpMlM3u_-QOKMp3gzcwQ xenolinux-2.4.21-sparse/init/do_mounts.c diff --git a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore index a31719cbf1..b69356bdb4 100644 --- a/BitKeeper/etc/ignore +++ b/BitKeeper/etc/ignore @@ -426,3 +426,4 @@ xen/tools/figlet/figlet xenolinux-2.4.16-sparse/arch/xeno/drivers/block/Makefile.orig xenolinux-2.4.16-sparse/arch/xeno/drivers/block/block.c.orig xenolinux-2.4.16-sparse/scripts/kconfig.tk +xenolinux-2.4.21-sparse/include/linux/blk.h~ diff --git a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c index 4d7c42ecdb..714c6bf082 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_ide.c @@ -125,7 +125,7 @@ static void setup_major(struct gendisk **pgd, } } - return gd; + return; } diff --git a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c index f3d049238f..c0f389f181 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_scsi.c @@ -70,7 +70,7 @@ int xlscsi_init(xen_disk_info_t *xdi) blksize_size[XLSCSI_MAJOR] = xlscsi_blksize_size; hardsect_size[XLSCSI_MAJOR] = xlscsi_hardsect_size; max_sectors[XLSCSI_MAJOR] = xlscsi_max_sectors; - read_ahead[XLSCSI_MAJOR] = NULL; //XXX8; + read_ahead[XLSCSI_MAJOR] = 0; //XXX8; blk_init_queue(BLK_DEFAULT_QUEUE(XLSCSI_MAJOR), do_xlblk_request); diff --git a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c index 59a3884de9..10bef36892 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/block/xl_segment_proc.c @@ -10,6 +10,8 @@ static struct proc_dir_entry *vhd; +extern unsigned short xldev_to_physdev(kdev_t xldev); + static int proc_read_vhd(char *page, char **start, off_t off, int count, int *eof, void *data) { diff --git a/xenolinux-2.4.21-sparse/arch/xeno/drivers/console/console.c b/xenolinux-2.4.21-sparse/arch/xeno/drivers/console/console.c index f38b021fb7..7ea44bd4c9 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/console/console.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/console/console.c @@ -61,7 +61,9 @@ static kdev_t xen_console_device(struct console *c) } static struct console xen_console_info = { - name: "xen_console", + name: "xencons", /* Used to be xen_console, but we're only + actually allowed 8 charcters including + the terminator... */ write: xen_console_write, device: xen_console_device, flags: CON_PRINTBUFFER, diff --git a/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c b/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c index f3eaeb4569..90d60f7804 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_core.c @@ -64,7 +64,6 @@ extern struct file_operations dom0_phd_fops; struct proc_dir_entry *xeno_base; static struct proc_dir_entry *dom0_cmd_intf; -static struct proc_dir_entry *proc_ft; static struct proc_dir_entry *dom_list_intf; unsigned long direct_mmap(unsigned long, unsigned long, pgprot_t, int, int); @@ -341,8 +340,6 @@ static int cmd_write_proc(struct file *file, const char *buffer, int ret = 0; struct proc_dir_entry * new_dom_id; dom0_newdomain_t * params; - int i; - unsigned long p; copy_from_user(&op, buffer, sizeof(dom0_op_t)); @@ -359,7 +356,7 @@ static int cmd_write_proc(struct file *file, const char *buffer, } else if ( op.cmd == DO_PGUPDATES ) { - ret = HYPERVISOR_pt_update(op.u.pgupdate.pgt_update_arr, + ret = HYPERVISOR_pt_update((void *)op.u.pgupdate.pgt_update_arr, op.u.pgupdate.num_pgt_updates); } else @@ -460,7 +457,7 @@ static int xeno_domains_show(struct seq_file *s, void *v) di -> u.getdominfo.state, di -> u.getdominfo.hyp_events, di -> u.getdominfo.mcu_advance, - di -> u.getdominfo.pg_head, + (void *)di -> u.getdominfo.pg_head, di -> u.getdominfo.tot_pages, di -> u.getdominfo.name); diff --git a/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c b/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c index 9d14070a1e..282ada24df 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/drivers/dom0/dom0_memory.c @@ -127,7 +127,7 @@ int direct_remap_disc_page_range(unsigned long from, unsigned long first_pg, int tot_pages, pgprot_t prot) { dom0_op_t dom0_op; - unsigned long *pfns = get_free_page(GFP_KERNEL); + unsigned long *pfns = (unsigned long *)get_free_page(GFP_KERNEL); unsigned long start = from; int pages, i; @@ -154,7 +154,7 @@ int direct_remap_disc_page_range(unsigned long from, } out: - free_page(pfns); + free_page((unsigned long)pfns); return tot_pages; } diff --git a/xenolinux-2.4.21-sparse/arch/xeno/kernel/process.c b/xenolinux-2.4.21-sparse/arch/xeno/kernel/process.c index 06cb7a3563..1bc9d0d17e 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/kernel/process.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/kernel/process.c @@ -347,8 +347,7 @@ void dump_thread(struct pt_regs * regs, struct user * dump) */ void __switch_to(struct task_struct *prev_p, struct task_struct *next_p) { - struct thread_struct *prev = &prev_p->thread, - *next = &next_p->thread; + struct thread_struct *next = &next_p->thread; __cli(); diff --git a/xenolinux-2.4.21-sparse/arch/xeno/kernel/traps.c b/xenolinux-2.4.21-sparse/arch/xeno/kernel/traps.c index c218067d2a..e9c2fd5a1c 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/kernel/traps.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/kernel/traps.c @@ -168,7 +168,6 @@ void show_stack(unsigned long * esp) void show_registers(struct pt_regs *regs) { - int i; int in_kernel = 1; unsigned long esp; unsigned short ss; @@ -200,19 +199,22 @@ void show_registers(struct pt_regs *regs) show_stack((unsigned long*)esp); #if 0 - printk("\nCode: "); - if(regs->eip < PAGE_OFFSET) - goto bad; - - for(i=0;i<20;i++) - { - unsigned char c; - if(__get_user(c, &((unsigned char*)regs->eip)[i])) { + { + int i; + printk("\nCode: "); + if(regs->eip < PAGE_OFFSET) + goto bad; + + for(i=0;i<20;i++) + { + unsigned char c; + if(__get_user(c, &((unsigned char*)regs->eip)[i])) { bad: - printk(" Bad EIP value."); - break; + printk(" Bad EIP value."); + break; + } + printk("%02x ", c); } - printk("%02x ", c); } #endif } diff --git a/xenolinux-2.4.21-sparse/arch/xeno/mm/hypervisor.c b/xenolinux-2.4.21-sparse/arch/xeno/mm/hypervisor.c index d67ad51dc5..1935595307 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/mm/hypervisor.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/mm/hypervisor.c @@ -96,7 +96,7 @@ void MULTICALL_flush_page_update_queue(void) #if PT_UPDATE_DEBUG > 0 DEBUG_allow_pt_reads(); #endif - queue_multicall2(__HYPERVISOR_pt_update, update_queue, idx); + queue_multicall2(__HYPERVISOR_pt_update, (unsigned long)update_queue, idx); idx = 0; } spin_unlock_irqrestore(&update_lock, flags); diff --git a/xenolinux-2.4.21-sparse/arch/xeno/mm/init.c b/xenolinux-2.4.21-sparse/arch/xeno/mm/init.c index 0806d775f7..462e51c501 100644 --- a/xenolinux-2.4.21-sparse/arch/xeno/mm/init.c +++ b/xenolinux-2.4.21-sparse/arch/xeno/mm/init.c @@ -284,7 +284,11 @@ static void __init set_max_mapnr_init(void) static int __init free_pages_init(void) { - int bad_ppro, reservedpages, pfn; +#ifdef CONFIG_HIGHMEM +#error Where is this supposed to be initialised? + int bad_ppro; +#endif + int reservedpages, pfn; /* this will put all low memory onto the freelists */ totalram_pages += free_all_bootmem(); diff --git a/xenolinux-2.4.21-sparse/include/asm-xeno/processor.h b/xenolinux-2.4.21-sparse/include/asm-xeno/processor.h index 3c4fa92b41..befcb4c410 100644 --- a/xenolinux-2.4.21-sparse/include/asm-xeno/processor.h +++ b/xenolinux-2.4.21-sparse/include/asm-xeno/processor.h @@ -372,7 +372,7 @@ struct thread_struct { }; #define INIT_THREAD { sizeof(init_stack) + (long) &init_stack, \ - 0, 0, 0, 0, 0, 0, {0}, 0, 0, 0, {0}, 0, 0, 0, 0, 0 } + 0, 0, 0, 0, 0, 0, {0}, 0, 0, 0, {{0}}, 0, 0, 0, 0, 0 } #define INIT_TSS { \ 0,0, /* back_link, __blh */ \ diff --git a/xenolinux-2.4.21-sparse/include/linux/blk.h b/xenolinux-2.4.21-sparse/include/linux/blk.h new file mode 100644 index 0000000000..6f5a738864 --- /dev/null +++ b/xenolinux-2.4.21-sparse/include/linux/blk.h @@ -0,0 +1,411 @@ +#ifndef _BLK_H +#define _BLK_H + +#include +#include +#include +#include + +/* + * Spinlock for protecting the request queue which + * is mucked around with in interrupts on potentially + * multiple CPU's.. + */ +extern spinlock_t io_request_lock; + +/* + * Initialization functions. + */ +extern int isp16_init(void); +extern int cdu31a_init(void); +extern int acsi_init(void); +extern int mcd_init(void); +extern int mcdx_init(void); +extern int sbpcd_init(void); +extern int aztcd_init(void); +extern int sony535_init(void); +extern int gscd_init(void); +extern int cm206_init(void); +extern int optcd_init(void); +extern int sjcd_init(void); +extern int cdi_init(void); +extern int hd_init(void); +extern int ide_init(void); +extern int xd_init(void); +extern int mfm_init(void); +extern int loop_init(void); +extern int md_init(void); +extern int ap_init(void); +extern int ddv_init(void); +extern int z2_init(void); +extern int swim3_init(void); +extern int swimiop_init(void); +extern int amiga_floppy_init(void); +extern int atari_floppy_init(void); +extern int ez_init(void); +extern int bpcd_init(void); +extern int ps2esdi_init(void); +extern int jsfd_init(void); +extern int viodasd_init(void); +extern int viocd_init(void); + +#if defined(CONFIG_ARCH_S390) +extern int dasd_init(void); +extern int xpram_init(void); +extern int tapeblock_init(void); +#endif /* CONFIG_ARCH_S390 */ + +#if defined(CONFIG_XENOLINUX_BLOCK) +extern int xlblk_init(void); +extern int xlseg_init(void); +extern int xlseg_proc_init(void); +#endif /* CONFIG_ARCH_XENO */ + +extern void set_device_ro(kdev_t dev,int flag); +void add_blkdev_randomness(int major); + +extern int floppy_init(void); +extern int rd_doload; /* 1 = load ramdisk, 0 = don't load */ +extern int rd_prompt; /* 1 = prompt for ramdisk, 0 = don't prompt */ +extern int rd_image_start; /* starting block # of image */ + +#ifdef CONFIG_BLK_DEV_INITRD + +#define INITRD_MINOR 250 /* shouldn't collide with /dev/ram* too soon ... */ + +extern unsigned long initrd_start,initrd_end; +extern int initrd_below_start_ok; /* 1 if it is not an error if initrd_start < memory_start */ +void initrd_init(void); + +#endif + + +/* + * end_request() and friends. Must be called with the request queue spinlock + * acquired. All functions called within end_request() _must_be_ atomic. + * + * Several drivers define their own end_request and call + * end_that_request_first() and end_that_request_last() + * for parts of the original function. This prevents + * code duplication in drivers. + */ + +static inline void blkdev_dequeue_request(struct request * req) +{ + list_del(&req->queue); +} + +int end_that_request_first(struct request *req, int uptodate, char *name); +void end_that_request_last(struct request *req); + +#if defined(MAJOR_NR) || defined(IDE_DRIVER) + +#undef DEVICE_ON +#undef DEVICE_OFF + +/* + * Add entries as needed. + */ + +#ifdef IDE_DRIVER + +#define DEVICE_NR(device) (MINOR(device) >> PARTN_BITS) +#define DEVICE_NAME "ide" + +#elif (MAJOR_NR == RAMDISK_MAJOR) + +/* ram disk */ +#define DEVICE_NAME "ramdisk" +#define DEVICE_NR(device) (MINOR(device)) +#define DEVICE_NO_RANDOM + +#elif (MAJOR_NR == Z2RAM_MAJOR) + +/* Zorro II Ram */ +#define DEVICE_NAME "Z2RAM" +#define DEVICE_REQUEST do_z2_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == FLOPPY_MAJOR) + +static void floppy_off(unsigned int nr); + +#define DEVICE_NAME "floppy" +#define DEVICE_INTR do_floppy +#define DEVICE_REQUEST do_fd_request +#define DEVICE_NR(device) ( (MINOR(device) & 3) | ((MINOR(device) & 0x80 ) >> 5 )) +#define DEVICE_OFF(device) floppy_off(DEVICE_NR(device)) + +#elif (MAJOR_NR == HD_MAJOR) + +/* Hard disk: timeout is 6 seconds. */ +#define DEVICE_NAME "hard disk" +#define DEVICE_INTR do_hd +#define TIMEOUT_VALUE (6*HZ) +#define DEVICE_REQUEST do_hd_request +#define DEVICE_NR(device) (MINOR(device)>>6) + +#elif (SCSI_DISK_MAJOR(MAJOR_NR)) + +#define DEVICE_NAME "scsidisk" +#define TIMEOUT_VALUE (2*HZ) +#define DEVICE_NR(device) (((MAJOR(device) & SD_MAJOR_MASK) << (8 - 4)) + (MINOR(device) >> 4)) + +/* Kludge to use the same number for both char and block major numbers */ +#elif (MAJOR_NR == MD_MAJOR) && defined(MD_DRIVER) + +#define DEVICE_NAME "Multiple devices driver" +#define DEVICE_REQUEST do_md_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == SCSI_TAPE_MAJOR) + +#define DEVICE_NAME "scsitape" +#define DEVICE_INTR do_st +#define DEVICE_NR(device) (MINOR(device) & 0x7f) + +#elif (MAJOR_NR == OSST_MAJOR) + +#define DEVICE_NAME "onstream" +#define DEVICE_INTR do_osst +#define DEVICE_NR(device) (MINOR(device) & 0x7f) +#define DEVICE_ON(device) +#define DEVICE_OFF(device) + +#elif (MAJOR_NR == SCSI_CDROM_MAJOR) + +#define DEVICE_NAME "CD-ROM" +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == XT_DISK_MAJOR) + +#define DEVICE_NAME "xt disk" +#define DEVICE_REQUEST do_xd_request +#define DEVICE_NR(device) (MINOR(device) >> 6) + +#elif (MAJOR_NR == PS2ESDI_MAJOR) + +#define DEVICE_NAME "PS/2 ESDI" +#define DEVICE_REQUEST do_ps2esdi_request +#define DEVICE_NR(device) (MINOR(device) >> 6) + +#elif (MAJOR_NR == CDU31A_CDROM_MAJOR) + +#define DEVICE_NAME "CDU31A" +#define DEVICE_REQUEST do_cdu31a_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == ACSI_MAJOR) && (defined(CONFIG_ATARI_ACSI) || defined(CONFIG_ATARI_ACSI_MODULE)) + +#define DEVICE_NAME "ACSI" +#define DEVICE_INTR do_acsi +#define DEVICE_REQUEST do_acsi_request +#define DEVICE_NR(device) (MINOR(device) >> 4) + +#elif (MAJOR_NR == MITSUMI_CDROM_MAJOR) + +#define DEVICE_NAME "Mitsumi CD-ROM" +/* #define DEVICE_INTR do_mcd */ +#define DEVICE_REQUEST do_mcd_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == MITSUMI_X_CDROM_MAJOR) + +#define DEVICE_NAME "Mitsumi CD-ROM" +/* #define DEVICE_INTR do_mcdx */ +#define DEVICE_REQUEST do_mcdx_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == MATSUSHITA_CDROM_MAJOR) + +#define DEVICE_NAME "Matsushita CD-ROM controller #1" +#define DEVICE_REQUEST do_sbpcd_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == MATSUSHITA_CDROM2_MAJOR) + +#define DEVICE_NAME "Matsushita CD-ROM controller #2" +#define DEVICE_REQUEST do_sbpcd2_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == MATSUSHITA_CDROM3_MAJOR) + +#define DEVICE_NAME "Matsushita CD-ROM controller #3" +#define DEVICE_REQUEST do_sbpcd3_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == MATSUSHITA_CDROM4_MAJOR) + +#define DEVICE_NAME "Matsushita CD-ROM controller #4" +#define DEVICE_REQUEST do_sbpcd4_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == AZTECH_CDROM_MAJOR) + +#define DEVICE_NAME "Aztech CD-ROM" +#define DEVICE_REQUEST do_aztcd_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == CDU535_CDROM_MAJOR) + +#define DEVICE_NAME "SONY-CDU535" +#define DEVICE_INTR do_cdu535 +#define DEVICE_REQUEST do_cdu535_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == GOLDSTAR_CDROM_MAJOR) + +#define DEVICE_NAME "Goldstar R420" +#define DEVICE_REQUEST do_gscd_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == CM206_CDROM_MAJOR) +#define DEVICE_NAME "Philips/LMS CD-ROM cm206" +#define DEVICE_REQUEST do_cm206_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == OPTICS_CDROM_MAJOR) + +#define DEVICE_NAME "DOLPHIN 8000AT CD-ROM" +#define DEVICE_REQUEST do_optcd_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == SANYO_CDROM_MAJOR) + +#define DEVICE_NAME "Sanyo H94A CD-ROM" +#define DEVICE_REQUEST do_sjcd_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == APBLOCK_MAJOR) + +#define DEVICE_NAME "apblock" +#define DEVICE_REQUEST ap_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == DDV_MAJOR) + +#define DEVICE_NAME "ddv" +#define DEVICE_REQUEST ddv_request +#define DEVICE_NR(device) (MINOR(device)>>PARTN_BITS) + +#elif (MAJOR_NR == MFM_ACORN_MAJOR) + +#define DEVICE_NAME "mfm disk" +#define DEVICE_INTR do_mfm +#define DEVICE_REQUEST do_mfm_request +#define DEVICE_NR(device) (MINOR(device) >> 6) + +#elif (MAJOR_NR == NBD_MAJOR) + +#define DEVICE_NAME "nbd" +#define DEVICE_REQUEST do_nbd_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == MDISK_MAJOR) + +#define DEVICE_NAME "mdisk" +#define DEVICE_REQUEST mdisk_request +#define DEVICE_NR(device) (MINOR(device)) + +#elif (MAJOR_NR == DASD_MAJOR) + +#define DEVICE_NAME "dasd" +#define DEVICE_REQUEST do_dasd_request +#define DEVICE_NR(device) (MINOR(device) >> PARTN_BITS) + +#elif (MAJOR_NR == I2O_MAJOR) + +#define DEVICE_NAME "I2O block" +#define DEVICE_REQUEST i2ob_request +#define DEVICE_NR(device) (MINOR(device)>>4) + +#elif (MAJOR_NR == COMPAQ_SMART2_MAJOR) + +#define DEVICE_NAME "ida" +#define TIMEOUT_VALUE (25*HZ) +#define DEVICE_REQUEST do_ida_request +#define DEVICE_NR(device) (MINOR(device) >> 4) + +#endif /* MAJOR_NR == whatever */ + +/* provide DEVICE_xxx defaults, if not explicitly defined + * above in the MAJOR_NR==xxx if-elif tree */ +#ifndef DEVICE_ON +#define DEVICE_ON(device) do {} while (0) +#endif +#ifndef DEVICE_OFF +#define DEVICE_OFF(device) do {} while (0) +#endif + +#if (MAJOR_NR != SCSI_TAPE_MAJOR) && (MAJOR_NR != OSST_MAJOR) +#if !defined(IDE_DRIVER) + +#ifndef CURRENT +#define CURRENT blkdev_entry_next_request(&blk_dev[MAJOR_NR].request_queue.queue_head) +#endif +#ifndef QUEUE_EMPTY +#define QUEUE_EMPTY list_empty(&blk_dev[MAJOR_NR].request_queue.queue_head) +#endif + +#ifndef DEVICE_NAME +#define DEVICE_NAME "unknown" +#endif + +#define CURRENT_DEV DEVICE_NR(CURRENT->rq_dev) + +#ifdef DEVICE_INTR +static void (*DEVICE_INTR)(void) = NULL; +#endif + +#define SET_INTR(x) (DEVICE_INTR = (x)) + +#ifdef DEVICE_REQUEST +static void (DEVICE_REQUEST)(request_queue_t *); +#endif + +#ifdef DEVICE_INTR +#define CLEAR_INTR SET_INTR(NULL) +#else +#define CLEAR_INTR +#endif + +#define INIT_REQUEST \ + if (QUEUE_EMPTY) {\ + CLEAR_INTR; \ + return; \ + } \ + if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) \ + panic(DEVICE_NAME ": request list destroyed"); \ + if (CURRENT->bh) { \ + if (!buffer_locked(CURRENT->bh)) \ + panic(DEVICE_NAME ": block not locked"); \ + } + +#endif /* !defined(IDE_DRIVER) */ + + +#ifndef LOCAL_END_REQUEST /* If we have our own end_request, we do not want to include this mess */ + +#if ! SCSI_BLK_MAJOR(MAJOR_NR) && (MAJOR_NR != COMPAQ_SMART2_MAJOR) + +static inline void end_request(int uptodate) { + struct request *req = CURRENT; + + if (end_that_request_first(req, uptodate, DEVICE_NAME)) + return; + +#ifndef DEVICE_NO_RANDOM + add_blkdev_randomness(MAJOR(req->rq_dev)); +#endif + DEVICE_OFF(req->rq_dev); + blkdev_dequeue_request(req); + end_that_request_last(req); +} + +#endif /* ! SCSI_BLK_MAJOR(MAJOR_NR) */ +#endif /* LOCAL_END_REQUEST */ + +#endif /* (MAJOR_NR != SCSI_TAPE_MAJOR) */ +#endif /* defined(MAJOR_NR) || defined(IDE_DRIVER) */ + +#endif /* _BLK_H */ -- 2.30.2